package cn.kp.learning.service.Impl;
import java.util.HashMap;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import cn.kp.learning.dao.CoreUserPermissionDao;
import cn.kp.learning.model.CoreUserPermission;
import cn.kp.learning.model.CoreUserPermissionExample;
import cn.kp.learning.service.CoreUserPermissionService;
@Service("coreUserPermissionService")
public class CoreUserPermissionServiceImpl implements CoreUserPermissionService {

	@Resource
	private CoreUserPermissionDao userPermissionDao;
	@Override
	public int addUserPermission(CoreUserPermission cup) {
		// TODO Auto-generated method stub
		return userPermissionDao.insertSelective(cup);
	}

	@Override
	public int deleteUserPermission(int id) {
		// TODO Auto-generated method stub
		return userPermissionDao.deleteByPrimaryKey(id);
	}

	@Override
	public List<CoreUserPermission> getPermissionList(
			CoreUserPermissionExample example) {
		// TODO Auto-generated method stub
		return userPermissionDao.selectByExample(example);
	}

	@Override
	public CoreUserPermission getPermission(HashMap<String, Object> hm) {
		// TODO Auto-generated method stub
		return userPermissionDao.selectByPrimaryKey(hm);
	}

	@Override
	public int countPermission(CoreUserPermissionExample example) {
		// TODO Auto-generated method stub
		return userPermissionDao.countByExample(example);
	}

}
